<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>


        // var point = {
        //     x: 0,
        //     y: 0,
        //     moveTo: function (x, y) {
        //         var that = this;
        //         var moveX = function (x) {  //1
        //             that.x = x;
        //             // this.x = x;
        //         };
        //         var moveY = function (y) { //1
        //             that.y = y;
        //             // this.y = y;
        //         }
        //         moveX(x); //1
        //         moveY(y);  //1
        //     }
        // };
        // point.moveTo(1, 1);
        // console.log(point.x);
        // console.log(point.y);
        // console.log(x) //
        // console.log(y) //















        var point = {
            x: 0,
            y: 0,
            moveTo: function (x, y) {
                var that=this  //point
                var moveX = function (x) {  //1
                    
                    this.x = x;
                    // window.x=1
                    
                };
                var moveY = function (y) { //1
                  
                    this.y = y;
                    // window.y=1

                   
                 }

               moveX(x); //1
               moveY(y);  //1
            //    window. moveX(x); //1
            //    window. moveY(y);  //1
            }
        };
        point.moveTo(1, 1);
        console.log(point.x);
        console.log(point.y);
        console.log(window.x) //
        console.log(y) //  window.y
    </script>
</body>

</html>